package com.baike.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

/**
 * @author:pjm
 */
@Configuration  //声明配置类
public class MyFreemarkerConfig {
    @Bean
    public FreeMarkerConfigurer freeMarkerConfigurer(){
        FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
        configurer.setDefaultEncoding("utf-8");
        //生成模板加载的路径
        configurer.setTemplateLoaderPath("classpath:freemarker");
        return configurer;
    }

}
